package com.pea.fow.util;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * @author liyinlong
 *com.pea.fow.util
 *MultipleDataSource.java
 * 2017年5月15日下午3:42:58
 */
public class MultipleDataSource extends AbstractRoutingDataSource  {

	 public static final String datasource = "datasource";  
	    public static final String datasource1 = "datasource1";  
	      
	    private static final ThreadLocal<String> dataSourceKey = new InheritableThreadLocal<String>();  
	  
	    public static void setDataSourceKey(String dataSource) {  
	        dataSourceKey.set(dataSource);  
	    }  
	  
	    @Override  
	    protected Object determineCurrentLookupKey() {  
	        // TODO Auto-generated method stub  
	        return dataSourceKey.get();  
	    } 

}
